﻿@using EquipmentAlarmSystem.Service.Models.Enum
@model AlarmTestingModel

@{
    ViewData["Title"] = "报警器测试";
}

<partial name="_SystemConfiguration" />


<style>
    table {
        border-collapse: collapse; /* 合并表格边框为一个单一的边框 */
        margin: 0 auto;
    }

    table, th, td {
        border: 1px solid black; /* 设置表格、表头和表格单元格的边框为1像素宽的黑色实线 */
        /* text-align: center; /* 水平居中 */ */
    }
    tr {
        height: 40px;
    }
</style>

<table>
    <tr>
        <th width="200px">服务状态：</th>
        <th width="200px">@Model.IsServerRun</th>
        <th width="200px">心跳时间戳：</th>
        <th width="200px">@Model.NextHeartbeatTimestamp</th>
        <th width="200px">当前时间戳：</th>
        <th width="200px">@Model.CurrentTimestamp</th>
    </tr>
    <tr>
        <th width="200px">报警器状态：</th>
        <th width="200px">@Model.AlarmStatus</th>
        <th width="200px">报警器地址：</th>
        <th width="200px">@Model.AlarmAddress</th>
        <th width="200px">时间差：</th>
        <th width="200px">@(Model.CurrentTimestamp - Model.NextHeartbeatTimestamp )</th>
    </tr>
</table>
<br>
<hr>



<form id="myForm" action="/Home/AlarmTesting" method="post">

    <!-- 下拉列表 -->
    <label for="MsgType">服务类型:</label>
    <select asp-items="Html.GetEnumSelectList<MessageType>()" name="MsgType"></select>

    <!-- 文本输入框 -->
    <label for="To">联系人:</label>
    <input type="text" id="To" name="To" required>

    <!-- 文本输入框 -->
    <label for="Content">内容:</label>
    <input type="text" id="Content" name="Content" style="width:400px" required>

    <!-- 提交按钮 -->
    <input type="submit" value="发送">
</form>
@if (Model.Content is not null && Model.Content.Length > 1)
{
    <br>
    <hr>
    <h1>@Model.Content</h1>
}
